package com.deram.ctin.serv.enter.impl;

import com.deram.ctin.common.bean.PageResult;
import com.deram.ctin.serv.enter.api.EnterChangeLogApi;
import com.deram.ctin.serv.enter.entity.BaseUpdateInfo;
import com.deram.ctin.serv.enter.entity.EnterChangeLog;
import com.deram.ctin.serv.enter.filter.EnterChangeLogFilter;
import com.deram.ctin.serv.enter.service.EnterChangeLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: jtt
 * @Description: 企业变更参数
 * @Date: 2017/9/13 11:19
 * @version: V1.0
 */
@RestController
public class EnterChangeLogApiImpl implements EnterChangeLogApi {

    @Autowired
    private EnterChangeLogService enterChangeLogService;

    @Override
    public List<EnterChangeLog> list(@RequestBody EnterChangeLogFilter param) {
        return enterChangeLogService.list(param);
    }

    @Override
    public EnterChangeLog save(@RequestBody EnterChangeLog param) {
        return enterChangeLogService.save(param);
    }

    @Override
    public EnterChangeLog findById(@RequestParam("id") Long id) {
        return  enterChangeLogService.find(id);
    }

    @Override
    public PageResult<EnterChangeLog> search(@RequestBody EnterChangeLogFilter filter, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) {
        return enterChangeLogService.search(filter, pageNo, pageSize);
    }

    @Override
    public void delete(Long id) {
        enterChangeLogService.delete(id);
    }

    @Override
    public void saveList(@RequestBody BaseUpdateInfo<EnterChangeLog> updateInfo) {
        enterChangeLogService.saveList(updateInfo);
    }

}
